#ifndef __DEEP_ZOOM_IMAGE_H__
#define __DEEP_ZOOM_IMAGE_H__

#include <stdlib.h>
#include "cairo/cairo.h"
#include "glib/glib-2.0/glib.h"
#include <math.h>
#include "DeepZoomImageDLL.h"

namespace DeepZoomImage
{

	/* @IncludeInKinds */
	/* @Namespace=System.Windows */
	struct DEEP_ZOOM_IMAGE_DLL Point {
	public:
		double x, y;

		Point () : x(0), y(0) {}

		Point (double x, double y)
		{
			this->x = x;
			this->y = y;
		}

		Point operator+ (const Point &point)
		{
			return Point (x + point.x,
				y + point.y);
		}

		Point operator- (const Point &point)
		{
			return Point (x - point.x,
				y - point.y);
		}

		Point operator* (double v)
		{
			return Point (x * v, y * v);
		}

		bool operator == (const Point &point) const
		{
			return fabs (point.x-x) < DBL_EPSILON && fabs (point.y-y) < DBL_EPSILON;
		}

		bool operator != (const Point &point) const
		{
			return !(*this == point);
		}

		Point Transform (cairo_matrix_t *matrix);

		//
		// FromStr
		//   Parses @s and return a new point in @p.  Returns true if
		//   this was successful, false otherwise.
		//
		static bool FromStr (const char *s, Point *p);	
	};
};
#endif /* __DEEP_ZOOM_IMAGE_H__ */
